import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;


public class Log {

	private LogManager logman;
	private Logger logger;
	private FileHandler fh;
	private static Log log=null;
	
	public static Log getInstance(){
		if (log==null) log=new Log();
		return log;
	}
	public Logger getLoger(){
		return logger;
	}
	
	
	private Log(){
		try { 
		logman = LogManager.getLogManager();
		fh= new FileHandler("log_test.txt",true);
		logger = Logger.getLogger("asd");
	    logman.addLogger(logger);
	     fh.setFormatter(new SimpleFormatter());
	     logger.addHandler(fh);
	     logger.setLevel(Level.ALL);
		 } catch (SecurityException e) {
				e.printStackTrace();
		} catch (IOException e) {
				e.printStackTrace();
		}
	      logger.setUseParentHandlers(false);
	}
	

	     
	
	
}
